<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<!DOCTYPE html>
<html lang="zh-CN"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.js"></script>
</head>
<body class="body">
	<jsp:include page="include/head.jsp">
		<jsp:param value="${ep}" name="ep"/>
	</jsp:include>
	
	
	<div class="container">
	  <div class="row">
		<div class="span3">
			<div style="padding: 8px 0;" class="well">
				<jsp:include page="include/nav.jsp">
					<jsp:param value="${ep}" name="ep"/>
				</jsp:include>
			</div>
		</div>
		<div class="span9">
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0">
				<li class="active">
					<a href="contact.jspx"><i class="icon-user"></i>联系人</a>
				</li>
			</ul>
			<div class="wall">
				<div class="row">
					<div class="span3">
						<a href="contact.jspx?_m=newContact" class="btn span2"><i class="icon-plus"></i>添加联系人</a>
						<div class="clear"></div>
						<ul class="unstyled" style="margin-top:15px">
							<c:if test="${fn:length(contactList) == 0 }">
								<li>没有联系人</li>
							</c:if>
							<c:forEach items="${contactList}" var = "contact">
								<li style="line-height:30px">
									<i class="icon-list-alt"></i><a href="contact.jspx?_m=showContact&id=${contact.id}">${contact.name}</a>
								</li>
							</c:forEach>
						</ul>
					</div>
					<c:if test="${fn:length(contactList) != 0 }">
					
						<div class="span5" style="min-height:400px;border-left:1px solid #ccc;padding-left:15px">
							<address>
								<img style="float:right;" src="https://chart.googleapis.com/chart?cht=qr&chs=200x200&choe=UTF-8&chld=L|1&chl=
										name:${contact.name};companyname:${contact.companyname};mobile=${contact.mobile};tel:${contact.tel};
										email:${contact.email};address:${contact.address};website:${contact.website};weibo:${contact.weibo}">
								<h3>${contact.name}</h3>
								<small>公司</small> ${contact.companyname}<br><br>
								<small>手机</small> ${contact.mobile}<br>
								<small>固话</small> ${contact.tel}<br><br>
								<small>邮箱</small> ${contact.email}<br>
								<small>地址</small> ${contact.address}<br><br>
								<small>主页</small> <a href="${contact.website}">${contact.website}</a><br>
								<small>微博</small> <a href="${contact.weibo}">${contact.weibo}</a><br>
							</address>
							<div class="line">记录</div>
							<c:if test="${fn:length(contactNoteList) == 0 }">
								<blockquote>
								 	没有记录！
								</blockquote>
							</c:if>
							<c:forEach items="${contactNoteList}" var = "contactNote" begin="0" end="3">
								<blockquote>
									  ${contactNote.content};
									  <small>${ep.employee.username}发布于 ${contactNote.createtime}</small>
								</blockquote>
							</c:forEach>
							<a href="contact.jspx?_m=contactNote&id=${contact.id}">查看所有记录</a>
							<br><br><br>
							<a class="btn btn-primary" href="contact.jspx?_m=editContact&id=${contact.id}"><i class="icon-pencil icon-white"></i>编辑</a>
							<a class="btn btn-danger" href="contact.jspx?_m=delContact&id=${contact.id}"><i class="icon-trash icon-white"></i>删除</a>
						</div>
					</c:if>
				</div>
			</div>
		</div>
	  </div>
	</div>
</body></html>